<template>
    <div>
        <h3>{{$store.getters.showNum}}</h3>
        <button @click="btnHandler1">-1</button>
        <button @click="btnHandler2">-N</button>
        <button @click="btnHandler3">-1 Async</button>
        <button @click="btnHandler4">-N Async</button>
    </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  computed: {
    count () {
      return this.$store.state.count
    }
  },
  created() {},
  methods: {
    btnHandler1() {
      this.$store.commit('sub')
    },
    btnHandler2() {
      this.$store.commit('subN', 3)
    },
    btnHandler3() {
      this.$store.dispatch('subAsync')
    },
    btnHandler4() {
      this.$store.dispatch('subNAsync', 5)
    }
  }
}
</script>

<style lang="less" scoped>

</style>
